home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cbibcode.arc
/
CREAT.C
< prev
next >
Wrap
Text File
|
1991-08-05
|
421b
|
17 lines
/* creat.c --- p 488 */
#include <stdio.h>
#include <sys\types.h>
#include <sys\stat.h>
#include <io.h>
main()
{
int handle;
unsigned char filename[81];
/* Ask user for file name */
printf("Enter name of file to be created: ");
gets(filename);
if ( (handle = creat(filename, S_IREAD | S_IWRITE)) == -1)
perror("Error creating file!");
else
printf("\nFile %s created\n", filename);
}